<?xml version="1.0" encoding="UTF-8"?>
<!--
  Created by IntelliJ IDEA.
  User: lukman
  Date: 6/24/11
  Time: 11:54 AM
-->
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<head>
    <title>Patients</title>
</head>

<body>
<ui:composition template="/resources/template/yiiTwoColtemplate.xhtml">
    <ui:define name="contentpart">
        <div id="content">
            <p:panel header="Update Patient" id="createPanel">
                <h:form id="create">
                    <p:growl id="formMessage"/>
                    <h:panelGrid id="grid" columns="2">
                        <h:panelGroup>
                            <h:panelGrid id="grid1" columns="2">
                                <h:outputText value="#{msgs.firstName}"/>
                                <h:outputText value="#{sessionScope.selectedPatient.name.firstName}" id="firstname"
                                              requiredMessage="Enter first name" required="true"/>

                                <h:outputText value="#{msgs.middleName}"/>
                                <p:inputText value="#{sessionScope.selectedPatient.name.middleName}" id="middlename"
                                             requiredMessage="Enter middle name" required="true"/>

                                <h:outputText value="#{msgs.lastName}"/>
                                <p:inputText value="#{sessionScope.selectedPatient.name.lastName}" id="lastname"
                                             requiredMessage="Enter last name" required="true"/>

                                <h:outputText value="#{msgs.age}"/>
                                <p:inputText value="#{sessionScope.selectedPatient.age}" id="age"
                                             requiredMessage="Enter last name" required="true"/>

                                <h:outputText value="#{msgs.emptyword}"/>
                                <h:panelGroup>
                                    <p:commandButton value="#{msgs.Cancelbutton}" immediate="true"
                                                     action="#{patientBean.clearPatientProperties}"/>
                                    <p:commandButton value="#{msgs.Updatebutton}" update="tableform formMessage"
                                                     action="#{patientBean.createPatient}"/>
                                </h:panelGroup>
                            </h:panelGrid>
                        </h:panelGroup>
                    </h:panelGrid>
                </h:form>

            </p:panel>
            <p:spacer height="20"/>
            <p:panel header="Records" id="record">
                <f:facet name="options">
                    <p:menu>
                        <p:submenu label="Settings">
                            <p:menuitem value="Toggle" url="#"
                                        icon="/images/update.png" onclick="panel.toggle()"/>
                            <p:menuitem value="Remove" url="#"
                                        icon="/images/delete.png" onclick="panel.close()"/>
                        </p:submenu>
                    </p:menu>
                </f:facet>


            </p:panel>
        </div>
    </ui:define>
    <ui:define name="operationspart">
        <h:form>
            <p:menu>
                <p:submenu label="Patient Operations">
                    <p:menuitem value="View all Users" url="users.xhtml"/>
                    <p:menuitem value="Manage Users" url="create.xhtml"/>
                </p:submenu>
            </p:menu>
        </h:form>
    </ui:define>
</ui:composition>
</body>

</html>